package com.woniu;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

public class Test {
    public static void main(String[] args) {
        BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource("applicationContext.xml"));
        Phone phone = (Phone) beanFactory.getBean("miPhone");
        phone.show();
        System.out.println(beanFactory.getBean("applePhone"));
        System.out.println(beanFactory.getBean("applePhone"));
        System.out.println(beanFactory.getBean("applePhone"));

    }
}
